package day0213;

import java.util.Arrays;

public class ArrayDemo06 {

    public static void main(String[] args) {
        /*
            删除元素
         */
        int[] arr = {1, 2, 3, 4, 5};

        int[] arr1 = new int[arr.length - 1];

        int index = 2;

        System.arraycopy(arr, 0, arr1, 0, index);
        System.arraycopy(arr, index + 1, arr1, index, arr.length - index - 1);

        System.out.println(Arrays.toString(arr1));
    }
}
